<?php
require_once 'classes/Login.php';
require_once 'classes/JobPost.php';
$Login = new Login;
$JobPost = new JobPost;
if(!$Login->verify())
{
    header('Location:index.php');
}
$companyInfo = $Login->getEmployerInfo($_SESSION['employerID']);
include 'includes/header.inc.php';
?>

<h1>Welcome, <?php echo $companyInfo['companyName']; ?>!</h1>
<hr>
<form id="updateAccount" method="post">
<input type="hidden" id="companyId" name="companyId" value="<?php echo $_SESSION['employerID']; ?>" />
    <table class="account">
        <tbody>
            <tr>
                <td class="label"><label for="companyName">Company Name:</label></td>
                <td><input type="text" id="companyName" name="companyName" value="<?php echo $companyInfo['companyName']; ?>"/></td>
            </tr>
            <tr>
                <td class="label"><label for="contactName">Contact Name:</label></td>
                <td><input type="text" id="contactName" name="contactName" value="<?php echo $companyInfo['contactName']; ?>"/></td>
            </tr>
            <tr>
                <td class="label"><label for="email">Email:</label></td>
                <td><input type="text" id="email" name="email" value="<?php echo $companyInfo['email']; ?>"/></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" id="empChanges" value="Submit Changes" class="submit"/></td>
            </tr>
        </tbody>
    </table>
</form>

<form id="changePass" method="post">
<input type="hidden" id="email" name="email" value="<?php echo $_SESSION['email']; ?>" />
    <table class="account">
        <tbody>
            <tr>
                <td class="label"><label for="currentPass">Current Password: </label></td>
                <td><input type="password" id="currentPass" name="currentPass"/></td>
            </tr>
            <tr>
                <td class="label"><label for="newPass">New Password: </label></td>
                <td><input type="password" id="newPass" name="newPass"/></td>
            </tr>
            <tr>
                <td class="label"><label for="newPass2">Re-Type New Password: </label></td>
                <td><input type="password" id="newPass2" name="newPass2"/></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" id="changePassSubmit" value="Change Password" class="submit"/></td>
            </tr>
        </tbody>
    </table>
</form>
<div id="loading"><img src="/sandbox1/media/images/loader.gif" alt="Loading..." /></div>
<div id="feedback"></div>
<?php
include 'includes/footer.inc.php';
?>